/*语句运行在SERV-U与SQLSERVER的数据库之上*/

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('dbo.ftp_sys_users') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
DROP TABLE dbo.ftp_sys_users
GO

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('dbo.ftp_sys_params') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
DROP TABLE dbo.ftp_sys_params
GO

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id('dbo.ftp_util_keytable') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
DROP TABLE dbo.ftp_util_keytable
GO

CREATE TABLE dbo.ftp_sys_users(
id int  NOT NULL,
username varchar(80) NOT NULL,
password varchar(100) ,
is_default int default 1, 
mail varchar(255),
description varchar(500)
) 
GO

insert into dbo.ftp_sys_users(id,username,password,is_default,description) values(1,'admin','4e076096531a3077e277c0885e933f98',0,'FTP管理员帐号');
insert into dbo.ftp_sys_users(id,username,password,is_default,description) values(2,'dpd','4e076096531a3077e277c0885e933f98',0,'FTP创建者帐号');
GO

CREATE TABLE dbo.ftp_sys_params(
id int  NOT NULL,
groupname varchar(80) NOT NULL,
p1 varchar(255) NOT NULL,
v1 varchar(255) NOT NULL,
p2 varchar(255) ,
v2 varchar(255) ,
p3 varchar(255) ,
v3 varchar(255) ,
p4 varchar(255) ,
v4 varchar(255) ,
p5 varchar(255) ,
v5 varchar(255) 
) 
GO

insert into dbo.ftp_sys_params(id,groupname,p1,v1,p2,v2,p3,v3,p4,v4) values(1,'发送邮箱信息','发送服务器','http://mail.163.com','发送邮箱','ftp_ceode@163.com','用户名','ftp_ceode','密码','ftp_ceode');
insert into dbo.ftp_sys_params(id,groupname,p1,v1) values(2,'常规账号有效期','有效期(天)','40');
insert into dbo.ftp_sys_params(id,groupname,p1,v1) values(3,'常规及长期账号存放目录','常规及长期账号','E:\\rsgsftp');
insert into dbo.ftp_sys_params(id,groupname,p1,v1) values(4,'临时账号存放目录','临时账号','Z:\\rsgsftptemp');
CREATE TABLE ftp_util_keytable(
id int  NOT NULL,
nextavailable int NOT NULL,
cacheSize int  NOT NULL,
tablename varchar(255)
) 
GO

insert into ftp_util_keytable(id,nextavailable,cacheSize) values(1,10,2);


